<template>
  <div class="project-container">
    <el-tabs v-model="activeTop" type="card" @tab-click="handleTop">
      <el-tab-pane label="项目1" name="1"></el-tab-pane>
    </el-tabs>
    <div class="list-group">
      <el-row :gutter="20">
        <el-col :span="12">
          <div class="list-items">
            <div class="list-title list-title-pad10">项目名称：</div>
            <el-input placeholder="" v-model="value"></el-input>
          </div>
        </el-col>
        <el-col :span="3">
          <div class="list-items">
            <div class="list-title list-title-pad10">项目代码：</div>
            <el-select v-model="value" placeholder="">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </div>
        </el-col>
        <el-col :span="3">
          <div class="list-items">
            <div class="list-title list-title-pad10">子项数：</div>
            <el-select v-model="value" placeholder="">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </div>
        </el-col>
        <el-col :span="3">
          <div class="list-items">
            <div class="list-title list-title-pad10">设备类型：</div>
            <el-select v-model="value" placeholder="">
              <el-option v-for="item in equipmentList" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </div>
        </el-col>
        <el-col :span="3">
          <div class="list-items">
            <div class="list-title list-title-pad10">设备型号：</div>
            <el-select v-model="value" placeholder="">
              <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
            </el-select>
          </div>
        </el-col>
      </el-row>
    </div>
    <div class="project-top">
      <div class="project-top-left group-border">
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">预读时间(s)：</div>
                <el-input-number v-model="value" :step="1" :precision="0" :min="30"></el-input-number>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">测试时间(s)：</div>
                <el-input-number v-model="value" :step="1" :precision="0" :min="60"></el-input-number>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <el-checkbox v-model="checked">是否时间分辨</el-checkbox>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">峰个数：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">判定值：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">基准线：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">判定峰序号：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">取值算法：</div>
                <el-select v-model="value" placeholder="">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <el-checkbox v-model="checked">读数反转</el-checkbox>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">反转基准值：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="project-top-center">
        <el-table :data="tableData" border ref="multipleTable" header-cell-class-name="table-header" height="30vh">
          <el-table-column label="序号" align="center" width="100" fixed>
            <template slot-scope="scope">{{ scope.$index + (query.pageIndex - 1) * query.pageSize + 1 }}</template>
          </el-table-column>
          <el-table-column label="起点" align="center">
            <template slot-scope="scope">{{ scope.row.nickname || scope.row.wechat_nickname }}</template>
          </el-table-column>
          <el-table-column label="终点" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.sex == 1">男</span>
              <span v-if="scope.row.sex == 2">女</span>
            </template>
          </el-table-column>
          <el-table-column label="取值" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
        </el-table>
      </div>
      <!-- <div class="project-top-right">
        <el-table :data="tableData" border ref="multipleTable" header-cell-class-name="table-header" height="30vh">
          <el-table-column label="样本名称" align="center" width="100" fixed>
            <template slot-scope="scope">{{ scope.$index + (query.pageIndex - 1) * query.pageSize + 1 }}</template>
          </el-table-column>
          <el-table-column label="加样量" align="center">
            <template slot-scope="scope">{{ scope.row.nickname || scope.row.wechat_nickname }}</template>
          </el-table-column>
          <el-table-column label="终点" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.sex == 1">男</span>
              <span v-if="scope.row.sex == 2">女</span>
            </template>
          </el-table-column>
          <el-table-column label="缓冲液量" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
          <el-table-column label="混合液量" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
        </el-table>
      </div> -->
    </div>
    <el-tabs v-model="activeChild" type="card" @tab-click="handleChild" @tab-remove="removeChild" style="margin-top:6px;">
      <el-tab-pane label="子项参数" name="0"></el-tab-pane>
      <el-tab-pane :label="item.label" :name="item.name" v-for="(item,index) in editableTabs" :key="index" closable></el-tab-pane>
    </el-tabs>
    <div class="project-top group-border-top">
      <div class="project-bottom-left group-border">
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">子项类型：</div>
                <el-select v-model="value" placeholder="">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">名称：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">中文名称：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">单位：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">请选择分段：</div>
                <el-select v-model="value" placeholder="">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
              </div>
            </el-col>
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">线序：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">公式：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="concentration">
          <div class="concentration-box">
            <div class="concentration-title">浓度参考范围</div>
            <div class="concentration-list">
              <div class="list-items list-items-pad">
                <div class="list-title">{{ '阴性<=' }}</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
              <div class="list-items list-items-pad">
                <div class="list-title">{{ '<阴性<=' }}</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
              <div class="list-items list-items-pad">
                <div class="list-title">{{ '<携带<=' }}</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
              <div class="list-items list-items-pad">
                <div class="list-title">{{ '<弱阳<=' }}</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
              <div class="list-items list-items-pad">
                <div class="list-title">{{ '<阳性<=' }}</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
              <div class="list-items list-items-pad">
                <div class="list-title">{{ '<强阳<=' }}</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
              <div class="list-items list-items-pad">
                <div class="list-title">{{ '<强阳' }}</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </div>
            <div class="list-group">
              <el-row :gutter="20">
                <el-col :span="12">
                  <div class="list-items">
                    <div class="list-title list-title-pad10">线性范围大：</div>
                    <el-input placeholder="" v-model="value"></el-input>
                  </div>
                </el-col>
                <el-col :span="12">
                  <div class="list-items">
                    <div class="list-title list-title-pad10">线性范围小：</div>
                    <el-input placeholder="" v-model="value"></el-input>
                  </div>
                </el-col>
              </el-row>
            </div>
            <div class="list-group">
              <el-row :gutter="20">
                <el-col :span="12">
                  <div class="list-items">
                    <div class="list-title list-title-pad10">范围小数位数：</div>
                    <el-select v-model="value" placeholder="">
                      <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                    </el-select>
                  </div>
                </el-col>
                <el-col :span="12">
                  <el-button type="primary" @click="dialog1=true">修改分段结论名称</el-button>
                </el-col>
              </el-row>
            </div>
          </div>
        </div>
      </div>
      <div class="project-bottom-right">
        <el-table :data="tableData" border ref="multipleTable" header-cell-class-name="table-header" height="35vh">
          <el-table-column label="序号" align="center" width="100" fixed>
            <template slot-scope="scope">{{ scope.$index + (query.pageIndex - 1) * query.pageSize + 1 }}</template>
          </el-table-column>
          <el-table-column label="样本名称" align="center">
            <template slot-scope="scope">{{ scope.row.nickname || scope.row.wechat_nickname }}</template>
          </el-table-column>
          <el-table-column label="稀释模式" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.sex == 1">男</span>
              <span v-if="scope.row.sex == 2">女</span>
            </template>
          </el-table-column>
          <el-table-column label="加样量" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
          <el-table-column label="一次稀释样本量" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
          <el-table-column label="一次稀释液量" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
          <el-table-column label="二次稀释样本量" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
          <el-table-column label="二次稀释液量" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
          <el-table-column label="孵育时间" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
        </el-table>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="8">
              <div class="list-items">
                <div class="list-title list-title-pad10">稀释瓶容量：</div>
                <el-input placeholder="" v-model="value"></el-input>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
    <div class="project-top group-border-top">
      <div class="project-bottom-left group-border">
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">子项序号：</div>
                <el-select v-model="value" placeholder="">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
              </div>
            </el-col>
          </el-row>
        </div>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">请选择分段：</div>
                <el-select v-model="value" placeholder="">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
              </div>
            </el-col>
          </el-row>
        </div>
        <el-table :data="tableData" border ref="multipleTable" header-cell-class-name="table-header" height="30vh">
          <el-table-column label="名称" align="center" width="100" fixed>
            <template slot-scope="scope">{{ scope.$index + (query.pageIndex - 1) * query.pageSize + 1 }}</template>
          </el-table-column>
          <el-table-column label="单位" align="center">
            <template slot-scope="scope">{{ scope.row.nickname || scope.row.wechat_nickname }}</template>
          </el-table-column>
          <el-table-column label="范围小" align="center">
            <template slot-scope="scope">
              <span v-if="scope.row.sex == 1">男</span>
              <span v-if="scope.row.sex == 2">女</span>
            </template>
          </el-table-column>
          <el-table-column label="范围大" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
          <el-table-column label="范围名称" align="center">
            <template slot-scope="scope">{{ scope.row.mobile }}</template>
          </el-table-column>
        </el-table>
        <div class="list-group">
          <el-row :gutter="20">
            <el-col :span="12">
              <div class="list-items">
                <div class="list-title list-title-pad10">范围小数位数：</div>
                <el-select v-model="value" placeholder="">
                  <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                </el-select>
              </div>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="project-bottom-right">
        <div class="group-border" style="padding:0 10px;">
          <div class="list-group">
            <el-row :gutter="20">
              <el-col :span="15">
                <div class="list-items">
                  <div class="list-title list-title-pad10">浓度计算逻辑：</div>
                  <el-select v-model="value" placeholder="">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                  </el-select>
                </div>
              </el-col>
            </el-row>
          </div>
          <div class="list-group">
            <el-row :gutter="20">
              <el-col :span="1">
                <div class="list-title">TC1：</div>
              </el-col>
              <el-col :span="4">
                <div class="list-items">
                  <div class="list-title">P1</div>
                  <el-select v-model="value" placeholder="">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                  </el-select>
                </div>
              </el-col>
              <el-col :span="5">
                <div class="list-items">
                  <div class="list-title">P2</div>
                  <el-select v-model="value" placeholder="">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                  </el-select>
                </div>
              </el-col>
              <el-col :span="5">
                <div class="list-items">
                  <div class="list-title">P3</div>
                  <el-select v-model="value" placeholder="">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                  </el-select>
                </div>
              </el-col>
            </el-row>
          </div>
          <div class="list-group">
            <el-row :gutter="20">
              <el-col :span="15">
                <div class="list-items">
                  <div class="list-title list-title-pad10">T/C公式：</div>
                  <el-select v-model="value" placeholder="">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
                  </el-select>
                </div>
              </el-col>
            </el-row>
          </div>
        </div>
      </div>
    </div>
    <el-dialog title="修改分段结论名称" :visible.sync="dialog1" width="50%" :close-on-click-modal="false">
      <el-form ref="form" :model="form" label-width="160px">
        <el-form-item label="结果判断区间1名称">
          <el-select v-model="form.value" placeholder="">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结果判断区间2名称">
          <el-select v-model="form.value" placeholder="">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结果判断区间3名称">
          <el-select v-model="form.value" placeholder="">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结果判断区间4名称">
          <el-select v-model="form.value" placeholder="">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结果判断区间5名称">
          <el-select v-model="form.value" placeholder="">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结果判断区间6名称">
          <el-select v-model="form.value" placeholder="">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="结果判断区间7名称">
          <el-select v-model="form.value" placeholder="">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialog1 = false">取 消</el-button>
        <el-button type="primary" @click="dialog1 = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'Project',
  data() {
    return {
      activeTop: '1',
      value: '',
      options: [{ value: '1', label: '1' }, { value: '2', label: '2' }],
      equipmentList: [{ value: '0', label: '人医' }, { value: '1', label: '食品' }, { value: '2', label: '宠物' }],
      tableData: [],
      editableTabs: [],
      checked: false,
      dialog1: false,
      activeChild: '',
      activeChildActive: '',
      form: {
        value: ''
      }
    };
  },
  mounted() {

  },
  methods: {
    handleTop(e) {

    },
    handleChild(e) {
      if (this.activeChild == 0) {
        let length = this.editableTabs.length;
        this.editableTabs.push({ name: (length + 1) + '', label: (length + 1) + '' })
      } else {
        this.activeChildActive = this.activeChild;
      }
    },
    removeChild(e) {
      if (this.activeChild == e) {
        this.activeChild = '1';
        this.activeChildActive = '1';
      }
      this.editableTabs.splice((e - 1), 1);
    }
  }
};
</script>

<style lang="less">
.project-container {
  padding: 0 10px;

  .project-top {
    display: flex;

    .project-top-left {
      width: 50%;
      padding: 0 10px;
    }

    .project-top-right {
      width: 0%;
    }

    .project-top-center {
      width: 50%;
      padding: 0 10px;
    }
  }

  .project-bottom-left {
    width: 50%;
    padding: 0 10px;
  }

  .project-bottom-right {
    width: 50%;
    padding-left: 10px;
  }

  .list-group {
    padding: 6px 0;
  }

  .list-items {
    display: flex;
    align-items: center;
  }
  .list-title {
    font-size: 13px;
    color: #333;
    height: 32px;
    line-height: 32px;
    white-space: nowrap;
  }

  .list-title-right {
    text-align: right;
  }

  .list-title-pad10 {
    padding-right: 10px;
    min-width: 90px;
  }

  .concentration {
    padding: 10px 0;

    .concentration-box {
      border: 1px solid #eee;
      border-radius: 4px;
      padding: 10px;
    }

    .concentration-title {
      padding: 10px;
      font-size: 16px;
      font-weight: bold;
    }

    .concentration-list {
      display: flex;
      flex-wrap: wrap;
    }
    .list-items-pad {
      padding: 6px 0;
    }
  }
  .group-border {
    border: 1px solid #eee;
    border-radius: 6px;
  }
  .group-border-top {
    border-bottom: 1px solid #eee;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    border-radius: 0 0 6px 6px;
    padding: 6px;
  }
  .el-tabs__header {
    margin: 0;
  }
}
</style>